#include "helper/sqlite/shortcut/Action.h"

#include "helper/sqlite/IDB.h"
#include "helper/sqlite/Statement.h"
#include "helper/sqlite/ActionResult.h"

namespace helper {
namespace sqlite {
namespace shortcut {

Action::Action(IDB & db)
: DBWrapper(db)
{
}
Action::~Action() {
}

ActionResult Action::action(const std::string & sql){
  std::error_code ec;
  auto && stmt = db().createStatement(sql, ec);
  return (!ec && stmt) ? stmt->action() : ActionResult(ec);
}

}//namespace shortcut
}//namespace sqlite
}//namespace helper
